home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cocktail / cg.lha / cg / m2c / EvalMod3.c < prev    next >
C/C++ Source or Header  |  1992-11-24  |  62KB  |  1,837 lines

  1. #include "SYSTEM_.h"
  2.  
  3. #ifndef DEFINITION_System
  4. #include "System.h"
  5. #endif
  6.  
  7. #ifndef DEFINITION_IO
  8. #include "IO.h"
  9. #endif
  10.  
  11. #ifndef DEFINITION_Tree
  12. #include "Tree.h"
  13. #endif
  14.  
  15. #ifndef DEFINITION_General
  16. #include "General.h"
  17. #endif
  18.  
  19. #ifndef DEFINITION_DynArray
  20. #include "DynArray.h"
  21. #endif
  22.  
  23. #ifndef DEFINITION_IO
  24. #include "IO.h"
  25. #endif
  26.  
  27. #ifndef DEFINITION_Texts
  28. #include "Texts.h"
  29. #endif
  30.  
  31. #ifndef DEFINITION_Sets
  32. #include "Sets.h"
  33. #endif
  34.  
  35. #ifndef DEFINITION_Relations
  36. #include "Relations.h"
  37. #endif
  38.  
  39. #ifndef DEFINITION_TreeMod1
  40. #include "TreeMod1.h"
  41. #endif
  42.  
  43. #ifndef DEFINITION_TreeMod2
  44. #include "TreeMod2.h"
  45. #endif
  46.  
  47. #ifndef DEFINITION_EvalMod
  48. #include "EvalMod.h"
  49. #endif
  50.  
  51. #ifndef DEFINITION_Errors
  52. #include "Errors.h"
  53. #endif
  54.  
  55. #ifndef DEFINITION_Positions
  56. #include "Positions.h"
  57. #endif
  58.  
  59. #ifndef DEFINITION_EvalMod
  60. #include "EvalMod.h"
  61. #endif
  62.  
  63. #ifndef DEFINITION_Tree
  64. #include "Tree.h"
  65. #endif
  66.  
  67. #ifndef DEFINITION_EvalMod3
  68. #include "EvalMod3.h"
  69. #endif
  70.  
  71. IO_tFile EvalMod3_yyf;
  72. PROC EvalMod3_Exit;
  73.  
  74. static SHORTCARD i, i2, j, k, n, MaxBit, MaxInstCount, Check;
  75. static Tree_tTree Node, Attr, ChildsClass;
  76. static BOOLEAN Success, IsStable;
  77. static LONGINT BitIndexSize;
  78. static Tree_tBitIndex gBitIndex;
  79. static Sets_tSet InhIndices;
  80. static LONGINT InhIndexSize;
  81. static struct S_1 {
  82.     SHORTCARD A[1000000 - 1 + 1];
  83. } *InhIndexCount;
  84. static void GenCall ARGS((Tree_tTree t, SHORTCARD j));
  85. static void GenEvalAttr ARGS((Tree_tTree t, INTEGER i));
  86. static void yyAbort ARGS((CHAR yyFunction[], LONGCARD ));
  87. static BOOLEAN yyIsEqual ARGS((BYTE yya[], LONGCARD , BYTE yyb[], LONGCARD ));
  88. struct S_4 {
  89.     union {
  90.         struct {
  91.             struct S_5 {
  92.                 SHORTCARD a;
  93.             } yyR2;
  94.         } V_1;
  95.     } U_1;
  96. };
  97. static void CompBitInfo ARGS((Tree_tTree t));
  98. struct S_6 {
  99.     union {
  100.         char dummy;
  101.     } U_1;
  102. };
  103. static void CompInhIndices ARGS((Tree_tTree t));
  104. struct S_7 {
  105.     union {
  106.         struct {
  107.             struct S_8 {
  108.                 INTEGER b;
  109.             } yyR1;
  110.         } V_1;
  111.     } U_1;
  112. };
  113. static void CountSynAttr ARGS((Tree_tTree t));
  114. struct S_9 {
  115.     union {
  116.         char dummy;
  117.     } U_1;
  118. };
  119. static void WriteType ARGS((Tree_tTree t));
  120. struct S_10 {
  121.     union {
  122.         char dummy;
  123.     } U_1;
  124. };
  125. static void GenS ARGS((Tree_tTree t));
  126. struct S_11 {
  127.     union {
  128.         char dummy;
  129.     } U_1;
  130. };
  131. static void GenE ARGS((Tree_tTree t));
  132. struct S_12 {
  133.     union {
  134.         struct {
  135.             struct S_13 {
  136.                 Sets_tSet ToCompute;
  137.             } yyR1;
  138.         } V_1;
  139.     } U_1;
  140. };
  141. static void CompOutput ARGS((Tree_tTree t));
  142. struct S_14 {
  143.     union {
  144.         char dummy;
  145.     } U_1;
  146. };
  147. static void CompOutput2 ARGS((Tree_tTree t));
  148. struct S_15 {
  149.     union {
  150.         char dummy;
  151.     } U_1;
  152. };
  153. struct S_16 {
  154.     union {
  155.         char dummy;
  156.     } U_1;
  157. };
  158. static INTEGER ToBit1 ARGS((Tree_tTree yyP4, INTEGER yyP3));
  159. struct S_17 {
  160.     union {
  161.         char dummy;
  162.     } U_1;
  163. };
  164. static INTEGER ToBit2 ARGS((Tree_tTree yyP7, Tree_tTree yyP6, SHORTCARD yyP5));
  165. struct S_18 {
  166.     union {
  167.         struct {
  168.             struct S_19 {
  169.                 INTEGER yyV1;
  170.             } yyR1;
  171.         } V_1;
  172.     } U_1;
  173. };
  174. static INTEGER ToAttr ARGS((Tree_tTree yyP9, INTEGER yyP8));
  175. struct S_20 {
  176.     union {
  177.         struct {
  178.             struct S_21 {
  179.                 INTEGER yyV1;
  180.             } yyR1;
  181.         } V_1;
  182.     } U_1;
  183. };
  184. static void GenEvaluator ARGS((Tree_tTree t));
  185. struct S_22 {
  186.     union {
  187.         struct {
  188.             struct S_23 {
  189.                 Tree_tTree TheClass;
  190.                 INTEGER k;
  191.             } yyR9;
  192.         } V_1;
  193.     } U_1;
  194. };
  195. static void yyExit ARGS(());
  196.  
  197.  
  198. static void GenCall
  199. # ifdef __STDC__
  200. (Tree_tTree t, SHORTCARD j)
  201. # else
  202. (t, j)
  203. Tree_tTree t;
  204. SHORTCARD j;
  205. # endif
  206. {
  207.   {
  208.     register Tree_tInstance *W_1 = &t->U_1.V_5.Class.Instance->A[j - 1];
  209.  
  210.     if (SET_IS_SUBSET1(SET_ELEM(Tree_Synthesized) | SET_ELEM(Tree_Left), W_1->Properties)) {
  211.       k = EvalMod3_ToBit0(t, (LONGINT)j);
  212.       IO_WriteS(Tree_f, (STRING)"IFNOTIN (", 9L);
  213.       Tree_WN((LONGINT)(k % TreeMod1_BSS));
  214.       IO_WriteS(Tree_f, (STRING)", yyt^.yyHead.yyIsComp", 22L);
  215.       Tree_WN((LONGINT)(k / TreeMod1_BSS));
  216.       IO_WriteS(Tree_f, (STRING)") ", 2L);
  217.       IO_WriteS(Tree_f, (STRING)"yyS", 3L);
  218.       Tree_WN((LONGINT)k);
  219.       IO_WriteS(Tree_f, (STRING)" (yyt); (* ", 11L);
  220.       Tree_WI(W_1->Attribute->U_1.V_9.Child.Name);
  221.       IO_WriteS(Tree_f, (STRING)" *) END;", 8L);
  222.       IO_WriteNl(Tree_f);
  223.     } else if (SET_IS_SUBSET1(SET_ELEM(Tree_Inherited) | SET_ELEM(Tree_Left), W_1->Properties)) {
  224.       k = EvalMod3_ToBit0(t, (LONGINT)j);
  225.       IO_WriteS(Tree_f, (STRING)"IFNOTIN (", 9L);
  226.       Tree_WN((LONGINT)(k % TreeMod1_BSS));
  227.       IO_WriteS(Tree_f, (STRING)", yyt^.yyHead.yyIsComp", 22L);
  228.       Tree_WN((LONGINT)(k / TreeMod1_BSS));
  229.       IO_WriteS(Tree_f, (STRING)") ", 2L);
  230.       if (Sets_IsElement(ORD('Z'), &Tree_Options) && IN(Tree_Trace, t->U_1.V_5.Class.Properties)) {
  231.         IO_WriteS(Tree_f, (STRING)"yyVisitParent (yyt); ", 21L);
  232.         IO_WriteS(Tree_f, (STRING)"yyI [yyt^.yyHead.yyOffset + ", 28L);
  233.         Tree_WN((LONGINT)k);
  234.         IO_WriteS(Tree_f, (STRING)"](yyt^.yyHead.yyParent); (* ", 28L);
  235.         Tree_WI(W_1->Attribute->U_1.V_9.Child.Name);
  236.         IO_WriteS(Tree_f, (STRING)" *) ", 4L);
  237.         IO_WriteS(Tree_f, (STRING)"yyWriteVisit (yyt^.yyHead.yyParent, \"?\"); END;", 46L);
  238.         IO_WriteNl(Tree_f);
  239.       } else {
  240.         IO_WriteS(Tree_f, (STRING)"yyI [yyt^.yyHead.yyOffset + ", 28L);
  241.         Tree_WN((LONGINT)k);
  242.         IO_WriteS(Tree_f, (STRING)"](yyt^.yyHead.yyParent); (* ", 28L);
  243.         Tree_WI(W_1->Attribute->U_1.V_9.Child.Name);
  244.         IO_WriteS(Tree_f, (STRING)" *) END;", 8L);
  245.         IO_WriteNl(Tree_f);
  246.       }
  247.     } else if (SET_IS_SUBSET1(SET_ELEM(Tree_Inherited) | SET_ELEM(Tree_Right), W_1->Properties)) {
  248.       k = ToBit1(W_1->Selector, (LONGINT)(j - t->U_1.V_5.Class.AttrCount - W_1->Selector->U_1.V_9.Child.InstOffset));
  249.       IO_WriteS(Tree_f, (STRING)"IFNOTIN (", 9L);
  250.       Tree_WN((LONGINT)(k % TreeMod1_BSS));
  251.       IO_WriteS(Tree_f, (STRING)", yyt^.", 7L);
  252.       Tree_WI(EvalMod_Class->U_1.V_5.Class.Name);
  253.       IO_WriteS(Tree_f, (STRING)".", 1L);
  254.       Tree_WI(W_1->Selector->U_1.V_9.Child.Name);
  255.       IO_WriteS(Tree_f, (STRING)"^.yyHead.yyIsComp", 17L);
  256.       Tree_WN((LONGINT)(k / TreeMod1_BSS));
  257.       IO_WriteS(Tree_f, (STRING)") ", 2L);
  258.       k = ToBit2(t, W_1->Selector, j);
  259.       IO_WriteS(Tree_f, (STRING)"yyI", 3L);
  260.       Tree_WN((LONGINT)k);
  261.       IO_WriteS(Tree_f, (STRING)" (yyt); (* ", 11L);
  262.       Tree_WI(W_1->Selector->U_1.V_9.Child.Name);
  263.       IO_WriteS(Tree_f, (STRING)":", 1L);
  264.       Tree_WI(W_1->Attribute->U_1.V_9.Child.Name);
  265.       IO_WriteS(Tree_f, (STRING)" *) END;", 8L);
  266.       IO_WriteNl(Tree_f);
  267.     } else if (SET_IS_SUBSET1(SET_ELEM(Tree_Synthesized) | SET_ELEM(Tree_Right), W_1->Properties)) {
  268.       k = ToBit1(W_1->Selector, (LONGINT)(j - t->U_1.V_5.Class.AttrCount - W_1->Selector->U_1.V_9.Child.InstOffset));
  269.       IO_WriteS(Tree_f, (STRING)"IFNOTIN (", 9L);
  270.       Tree_WN((LONGINT)(k % TreeMod1_BSS));
  271.       IO_WriteS(Tree_f, (STRING)", yyt^.", 7L);
  272.       Tree_WI(EvalMod_Class->U_1.V_5.Class.Name);
  273.       IO_WriteS(Tree_f, (STRING)".", 1L);
  274.       Tree_WI(W_1->Selector->U_1.V_9.Child.Name);
  275.       IO_WriteS(Tree_f, (STRING)"^.yyHead.yyIsComp", 17L);
  276.       Tree_WN((LONGINT)(k / TreeMod1_BSS));
  277.       IO_WriteS(Tree_f, (STRING)") ", 2L);
  278.       if (Sets_IsElement(ORD('Z'), &Tree_Options) && IN(Tree_Trace, t->U_1.V_5.Class.Properties)) {
  279.         IO_WriteS(Tree_f, (STRING)"yyWriteVisit (yyt, \"", 20L);
  280.         Tree_WI(W_1->Selector->U_1.V_9.Child.Name);
  281.         IO_WriteS(Tree_f, (STRING)"\"); ", 4L);
  282.         IO_WriteS(Tree_f, (STRING)"yyS", 3L);
  283.         Tree_WN((LONGINT)k);
  284.         IO_WriteS(Tree_f, (STRING)" (yyt^.", 7L);
  285.         Tree_WI(EvalMod_Class->U_1.V_5.Class.Name);
  286.         IO_WriteS(Tree_f, (STRING)".", 1L);
  287.         Tree_WI(W_1->Selector->U_1.V_9.Child.Name);
  288.         IO_WriteS(Tree_f, (STRING)"); (* ", 6L);
  289.         Tree_WI(W_1->Selector->U_1.V_9.Child.Name);
  290.         IO_WriteS(Tree_f, (STRING)":", 1L);
  291.         Tree_WI(W_1->Attribute->U_1.V_9.Child.Name);
  292.         IO_WriteS(Tree_f, (STRING)" *) ", 4L);
  293.         IO_WriteS(Tree_f, (STRING)"yyVisitParent (yyt^.", 20L);
  294.         Tree_WI(EvalMod_Class->U_1.V_5.Class.Name);
  295.         IO_WriteS(Tree_f, (STRING)".", 1L);
  296.         Tree_WI(W_1->Selector->U_1.V_9.Child.Name);
  297.         IO_WriteS(Tree_f, (STRING)"); END;", 7L);
  298.         IO_WriteNl(Tree_f);
  299.       } else {
  300.         IO_WriteS(Tree_f, (STRING)"yyS", 3L);
  301.         Tree_WN((LONGINT)k);
  302.         IO_WriteS(Tree_f, (STRING)" (yyt^.", 7L);
  303.         Tree_WI(EvalMod_Class->U_1.V_5.Class.Name);
  304.         IO_WriteS(Tree_f, (STRING)".", 1L);
  305.         Tree_WI(W_1->Selector->U_1.V_9.Child.Name);
  306.         IO_WriteS(Tree_f, (STRING)"); (* ", 6L);
  307.         Tree_WI(W_1->Selector->U_1.V_9.Child.Name);
  308.         IO_WriteS(Tree_f, (STRING)":", 1L);
  309.         Tree_WI(W_1->Attribute->U_1.V_9.Child.Name);
  310.         IO_WriteS(Tree_f, (STRING)" *) END;", 8L);
  311.         IO_WriteNl(Tree_f);
  312.       }
  313.     }
  314.   }
  315. }
  316.  
  317. static void GenEvalAttr
  318. # ifdef __STDC__
  319. (Tree_tTree t, INTEGER i)
  320. # else
  321. (t, i)
  322. Tree_tTree t;
  323. INTEGER i;
  324. # endif
  325. {
  326.   EvalMod_Class = t;
  327.   {
  328.     register Tree_tInstance *W_2 = &t->U_1.V_5.Class.Instance->A[i - 1];
  329.  
  330.     if (Sets_IsElement(ORD('X'), &Tree_Options) && IN(Tree_Trace, t->U_1.V_5.Class.Properties)) {
  331.       IO_WriteS(Tree_f, (STRING)"yyWriteEval (yyt, \"", 19L);
  332.       Tree_WI(W_2->Attribute->U_1.V_9.Child.Name);
  333.       IO_WriteS(Tree_f, (STRING)"\");", 3L);
  334.       IO_WriteNl(Tree_f);
  335.       if (W_2->Action != ADR(W_2->Action) && !IN(Tree_Virtual, W_2->Properties)) {
  336.         GenEvaluator(W_2->Action);
  337.         EvalMod_GenEvaluator(W_2->Action);
  338.         IO_WriteNl(Tree_f);
  339.         if (IN(Tree_Test, W_2->Properties)) {
  340.           IO_WriteS(Tree_f, (STRING)"writeBOOLEAN (yyb) yyWriteNl;", 29L);
  341.           IO_WriteNl(Tree_f);
  342.         } else if (W_2->Attribute->U_1.V_1.Kind == Tree_Child || W_2->Attribute->U_1.V_10.Attribute.Type == Tree_itTree) {
  343.           IO_WriteS(Tree_f, (STRING)"write", 5L);
  344.           Tree_WI(Tree_itTree);
  345.           IO_WriteS(Tree_f, (STRING)" (yyt^.", 7L);
  346.           Tree_WI(t->U_1.V_5.Class.Name);
  347.           IO_WriteS(Tree_f, (STRING)".", 1L);
  348.           Tree_WI(W_2->Attribute->U_1.V_9.Child.Name);
  349.           IO_WriteS(Tree_f, (STRING)")", 1L);
  350.           IO_WriteNl(Tree_f);
  351.         } else {
  352.           IO_WriteS(Tree_f, (STRING)"write", 5L);
  353.           Tree_WI(W_2->Attribute->U_1.V_9.Child.Type);
  354.           IO_WriteS(Tree_f, (STRING)" (yyt^.", 7L);
  355.           Tree_WI(t->U_1.V_5.Class.Name);
  356.           IO_WriteS(Tree_f, (STRING)".", 1L);
  357.           Tree_WI(W_2->Attribute->U_1.V_9.Child.Name);
  358.           IO_WriteS(Tree_f, (STRING)") yyWriteNl;", 12L);
  359.           IO_WriteNl(Tree_f);
  360.         }
  361.       } else {
  362.         IO_WriteS(Tree_f, (STRING)"yyWriteNl;", 10L);
  363.         IO_WriteNl(Tree_f);
  364.       }
  365.     } else if (Sets_IsElement(ORD('Y'), &Tree_Options) && IN(Tree_Trace, t->U_1.V_5.Class.Properties)) {
  366.       IO_WriteS(Tree_f, (STRING)"yyWriteEval (yyt, \"", 19L);
  367.       Tree_WI(W_2->Attribute->U_1.V_9.Child.Name);
  368.       IO_WriteS(Tree_f, (STRING)"\");", 3L);
  369.       IO_WriteNl(Tree_f);
  370.       if (W_2->Action != ADR(W_2->Action) && !IN(Tree_Virtual, W_2->Properties)) {
  371.         GenEvaluator(W_2->Action);
  372.         EvalMod_GenEvaluator(W_2->Action);
  373.       }
  374.     } else {
  375.       if (W_2->Action != ADR(W_2->Action) && !IN(Tree_Virtual, W_2->Properties)) {
  376.         GenEvaluator(W_2->Action);
  377.         EvalMod_GenEvaluator(W_2->Action);
  378.       }
  379.     }
  380.   }
  381. }
  382.  
  383. static void yyAbort
  384. # ifdef __STDC__
  385. (CHAR yyFunction[], LONGCARD O_1)
  386. # else
  387. (yyFunction, O_1)
  388. CHAR yyFunction[];
  389. LONGCARD O_1;
  390. # endif
  391. {
  392.   OPEN_ARRAY_LOCALS
  393.  
  394.   ALLOC_OPEN_ARRAYS(O_1 * sizeof(CHAR), 1)
  395.   COPY_OPEN_ARRAY(yyFunction, O_1, CHAR)
  396.   IO_WriteS((System_tFile)IO_StdError, (STRING)"Error: module EvalMod3, routine ", 32L);
  397.   IO_WriteS((System_tFile)IO_StdError, yyFunction, O_1);
  398.   IO_WriteS((System_tFile)IO_StdError, (STRING)" failed", 7L);
  399.   IO_WriteNl((System_tFile)IO_StdError);
  400.   (*EvalMod3_Exit)();
  401.   FREE_OPEN_ARRAYS
  402. }
  403.  
  404. static BOOLEAN yyIsEqual
  405. # ifdef __STDC__
  406. (BYTE yya[], LONGCARD O_3, BYTE yyb[], LONGCARD O_2)
  407. # else
  408. (yya, O_3, yyb, O_2)
  409. BYTE yya[];
  410. LONGCARD O_3;
  411. BYTE yyb[];
  412. LONGCARD O_2;
  413. # endif
  414. {
  415.   INTEGER yyi;
  416.   OPEN_ARRAY_LOCALS
  417.  
  418.   ALLOC_OPEN_ARRAYS(O_2 * sizeof(WORD) + O_3 * sizeof(WORD), 2)
  419.   COPY_OPEN_ARRAY(yyb, O_2, WORD)
  420.   COPY_OPEN_ARRAY(yya, O_3, WORD)
  421.   {
  422.     LONGINT B_1 = 0, B_2 = (INTEGER)(O_3 - 1);
  423.  
  424.     if (B_1 <= B_2)
  425.       for (yyi = B_1;; yyi += 1) {
  426.         if (yya[yyi] != yyb[yyi]) {
  427.           FREE_OPEN_ARRAYS
  428.           return FALSE;
  429.         }
  430.         if (yyi >= B_2) break;
  431.       }
  432.   }
  433.   FREE_OPEN_ARRAYS
  434.   return TRUE;
  435. }
  436.  
  437. void EvalMod3_EvalImplMod
  438. # ifdef __STDC__
  439. (Tree_tTree t)
  440. # else
  441. (t)
  442. Tree_tTree t;
  443. # endif
  444. {
  445.   struct S_4 yyTempo;
  446.  
  447.   if (t == Tree_NoTree) {
  448.     return;
  449.   }
  450.   if (t->U_1.V_1.Kind == Tree_Ag) {
  451.     {
  452.       register Tree_yAg *W_3 = &t->U_1.V_26.Ag;
  453.  
  454.       MaxBit = 0;
  455.       MaxInstCount = 0;
  456.       Tree_ForallClasses(W_3->Classes, (Tree_ProcOfT)CompBitInfo);
  457.       Sets_MakeSet(&InhIndices, (LONGCARD)MaxInstCount);
  458.       InhIndexSize = MaxInstCount;
  459.       DynArray_MakeArray((ADDRESS *)&InhIndexCount, &InhIndexSize, (LONGINT)sizeof(SHORTCARD));
  460.       {
  461.         SHORTCARD B_3 = 1, B_4 = MaxInstCount;
  462.  
  463.         if (B_3 <= B_4)
  464.           for (i = B_3;; i += 1) {
  465.             InhIndexCount->A[i - 1] = 0;
  466.             if (i >= B_4) break;
  467.           }
  468.       }
  469.       Tree_ForallClasses(W_3->Classes, (Tree_ProcOfT)CompInhIndices);
  470.       IO_WriteS(Tree_f, (STRING)"# define IFNOTIN(b, s) IF NOT (b IN s) THEN", 43L);
  471.       IO_WriteNl(Tree_f);
  472.       IO_WriteS(Tree_f, (STRING)"# define REMOTE_SYN(i, b, c, n, t, a) n^.t.a", 44L);
  473.       IO_WriteNl(Tree_f);
  474.       IO_WriteS(Tree_f, (STRING)"# define REMOTE_INH(i, b, k, n, t, a) n^.t.a", 44L);
  475.       IO_WriteNl(Tree_f);
  476.       EvalMod_EvalImplHead(t);
  477.       IO_WriteNl(Tree_f);
  478.       IO_WriteS(Tree_f, (STRING)"VAR yyI: ARRAY [0..", 19L);
  479.       Tree_WN((LONGINT)Sets_Maximum(&InhIndices));
  480.       IO_WriteS(Tree_f, (STRING)"] OF ", 5L);
  481.       Tree_WI(Tree_iMain);
  482.       IO_WriteS(Tree_f, (STRING)".tProcTree;", 11L);
  483.       IO_WriteNl(Tree_f);
  484.       IO_WriteNl(Tree_f);
  485.       IO_WriteS(Tree_f, (STRING)"PROCEDURE yyAbort (yyt: ", 24L);
  486.       Tree_WI(Tree_iMain);
  487.       IO_WriteS(Tree_f, (STRING)".", 1L);
  488.       Tree_WI(Tree_itTree);
  489.       IO_WriteS(Tree_f, (STRING)");", 2L);
  490.       IO_WriteNl(Tree_f);
  491.       IO_WriteS(Tree_f, (STRING)" BEGIN", 6L);
  492.       IO_WriteNl(Tree_f);
  493.       IO_WriteS(Tree_f, (STRING)"  IO.WriteS (IO.StdError, 'Error: module ", 41L);
  494.       Tree_WI(W_3->EvalName);
  495.       IO_WriteS(Tree_f, (STRING)", cyclic dependencies');", 24L);
  496.       IO_WriteNl(Tree_f);
  497.       IO_WriteS(Tree_f, (STRING)"  IO.WriteNl (IO.StdError);", 27L);
  498.       IO_WriteNl(Tree_f);
  499.       IO_WriteS(Tree_f, (STRING)"  IO.CloseIO;", 13L);
  500.       IO_WriteNl(Tree_f);
  501.       IO_WriteS(Tree_f, (STRING)"  ", 2L);
  502.       Tree_WI(Tree_iMain);
  503.       IO_WriteS(Tree_f, (STRING)".yyExit;", 8L);
  504.       IO_WriteNl(Tree_f);
  505.       IO_WriteS(Tree_f, (STRING)" END yyAbort;", 13L);
  506.       IO_WriteNl(Tree_f);
  507.       IO_WriteNl(Tree_f);
  508.       if (!Sets_IsElement(ORD('9'), &Tree_Options)) {
  509.         IO_WriteNl(Tree_f);
  510.         IO_WriteS(Tree_f, (STRING)"PROCEDURE Eval (yyt: ", 21L);
  511.         Tree_WI(Tree_iMain);
  512.         IO_WriteS(Tree_f, (STRING)".", 1L);
  513.         Tree_WI(Tree_itTree);
  514.         IO_WriteS(Tree_f, (STRING)");", 2L);
  515.         IO_WriteNl(Tree_f);
  516.         IO_WriteS(Tree_f, (STRING)" BEGIN ", 7L);
  517.         Tree_WI(Tree_iMain);
  518.         IO_WriteS(Tree_f, (STRING)".Init", 5L);
  519.         Tree_WI(Tree_iModule);
  520.         IO_WriteS(Tree_f, (STRING)" (yyt); yyE (yyt); END Eval;", 28L);
  521.         IO_WriteNl(Tree_f);
  522.       } else {
  523.         IO_WriteNl(Tree_f);
  524.         IO_WriteS(Tree_f, (STRING)"VAR xxStack: CARDINAL;", 22L);
  525.         IO_WriteNl(Tree_f);
  526.         IO_WriteNl(Tree_f);
  527.         IO_WriteS(Tree_f, (STRING)"PROCEDURE Eval (yyt: ", 21L);
  528.         Tree_WI(Tree_iMain);
  529.         IO_WriteS(Tree_f, (STRING)".", 1L);
  530.         Tree_WI(Tree_itTree);
  531.         IO_WriteS(Tree_f, (STRING)");", 2L);
  532.         IO_WriteNl(Tree_f);
  533.         IO_WriteS(Tree_f, (STRING)" VAR xxHigh: BOOLEAN;", 21L);
  534.         IO_WriteNl(Tree_f);
  535.         IO_WriteS(Tree_f, (STRING)" BEGIN", 6L);
  536.         IO_WriteNl(Tree_f);
  537.         IO_WriteS(Tree_f, (STRING)"  xxStack := MAX (INTEGER);", 27L);
  538.         IO_WriteNl(Tree_f);
  539.         IO_WriteS(Tree_f, (STRING)"  ", 2L);
  540.         Tree_WI(Tree_iMain);
  541.         IO_WriteS(Tree_f, (STRING)".Init", 5L);
  542.         Tree_WI(Tree_iModule);
  543.         IO_WriteS(Tree_f, (STRING)" (yyt); yyE (yyt);", 18L);
  544.         IO_WriteNl(Tree_f);
  545.         IO_WriteS(Tree_f, (STRING)"  IO.WriteS (IO.StdOutput, 'Stacksize ');", 41L);
  546.         IO_WriteNl(Tree_f);
  547.         IO_WriteS(Tree_f, (STRING)"  IO.WriteI (IO.StdOutput, CARDINAL (SYSTEM.ADR (xxHigh)) - xxStack, 0);", 72L);
  548.         IO_WriteNl(Tree_f);
  549.         IO_WriteS(Tree_f, (STRING)"  IO.WriteNl (IO.StdOutput);", 28L);
  550.         IO_WriteNl(Tree_f);
  551.         IO_WriteS(Tree_f, (STRING)" END Eval;", 10L);
  552.         IO_WriteNl(Tree_f);
  553.       }
  554.       IO_WriteNl(Tree_f);
  555.       do {
  556.         IsStable = TRUE;
  557.         Tree_ForallClasses(W_3->Classes, (Tree_ProcOfT)CompOutput);
  558.       } while (!IsStable);
  559.       IO_WriteS(Tree_f, (STRING)"PROCEDURE yyE (yyt: ", 20L);
  560.       Tree_WI(Tree_iMain);
  561.       IO_WriteS(Tree_f, (STRING)".", 1L);
  562.       Tree_WI(Tree_itTree);
  563.       IO_WriteS(Tree_f, (STRING)");", 2L);
  564.       IO_WriteNl(Tree_f);
  565.       TreeMod2_WriteLine(Tree_TreeRoot->U_1.V_26.Ag.EvalCodes->U_1.V_12.Codes.LocalLine);
  566.       Texts_WriteText(Tree_f, Tree_TreeRoot->U_1.V_26.Ag.EvalCodes->U_1.V_12.Codes.Local);
  567.       Node = Tree_TreeRoot->U_1.V_26.Ag.Modules;
  568.       while (Node->U_1.V_1.Kind == Tree_Module) {
  569.         TreeMod2_WriteLine(Node->U_1.V_43.Module.EvalCodes->U_1.V_12.Codes.LocalLine);
  570.         Texts_WriteText(Tree_f, Node->U_1.V_43.Module.EvalCodes->U_1.V_12.Codes.Local);
  571.         Node = Node->U_1.V_43.Module.Next;
  572.       }
  573.       if (Sets_IsElement(ORD('9'), &Tree_Options)) {
  574.         IO_WriteS(Tree_f, (STRING)" VAR xxLow: BOOLEAN;", 20L);
  575.         IO_WriteNl(Tree_f);
  576.         IO_WriteS(Tree_f, (STRING)" BEGIN", 6L);
  577.         IO_WriteNl(Tree_f);
  578.         IO_WriteS(Tree_f, (STRING)"  xxStack := General.Min (xxStack, CARDINAL (SYSTEM.ADR (xxLow)));", 66L);
  579.         IO_WriteNl(Tree_f);
  580.       } else {
  581.         IO_WriteS(Tree_f, (STRING)" BEGIN", 6L);
  582.         IO_WriteNl(Tree_f);
  583.       }
  584.       IO_WriteS(Tree_f, (STRING)"  LOOP", 6L);
  585.       IO_WriteNl(Tree_f);
  586.       IO_WriteS(Tree_f, (STRING)"   IF (yyt = ", 13L);
  587.       Tree_WI(Tree_iMain);
  588.       IO_WriteS(Tree_f, (STRING)".", 1L);
  589.       Tree_WI(Tree_iNoTree);
  590.       IO_WriteS(Tree_f, (STRING)") OR (0 IN yyt^.yyHead.yyIsComp0) THEN RETURN; END;", 51L);
  591.       IO_WriteNl(Tree_f);
  592.       IO_WriteS(Tree_f, (STRING)"   INCL (yyt^.yyHead.yyIsComp0, 0);", 35L);
  593.       IO_WriteNl(Tree_f);
  594.       IO_WriteS(Tree_f, (STRING)"   CASE yyt^.Kind OF", 20L);
  595.       IO_WriteNl(Tree_f);
  596.       Tree_ForallClasses(W_3->Classes, (Tree_ProcOfT)GenE);
  597.       IO_WriteS(Tree_f, (STRING)"   ELSE RETURN;", 15L);
  598.       IO_WriteNl(Tree_f);
  599.       IO_WriteS(Tree_f, (STRING)"   END;", 7L);
  600.       IO_WriteNl(Tree_f);
  601.       IO_WriteS(Tree_f, (STRING)"  END;", 6L);
  602.       IO_WriteNl(Tree_f);
  603.       IO_WriteS(Tree_f, (STRING)" END yyE;", 9L);
  604.       IO_WriteNl(Tree_f);
  605.       IO_WriteNl(Tree_f);
  606.       {
  607.         SHORTCARD B_5 = 2, B_6 = MaxBit;
  608.  
  609.         if (B_5 <= B_6)
  610.           for (i = B_5;; i += 1) {
  611.             n = 0;
  612.             Tree_ForallClasses(W_3->Classes, (Tree_ProcOfT)CountSynAttr);
  613.             if (n > 0) {
  614.               IO_WriteS(Tree_f, (STRING)"PROCEDURE yyS", 13L);
  615.               Tree_WN((LONGINT)(i - 1));
  616.               IO_WriteS(Tree_f, (STRING)" (yyt: ", 7L);
  617.               Tree_WI(Tree_iMain);
  618.               IO_WriteS(Tree_f, (STRING)".", 1L);
  619.               Tree_WI(Tree_itTree);
  620.               IO_WriteS(Tree_f, (STRING)");", 2L);
  621.               IO_WriteNl(Tree_f);
  622.               TreeMod2_WriteLine(Tree_TreeRoot->U_1.V_26.Ag.EvalCodes->U_1.V_12.Codes.LocalLine);
  623.               Texts_WriteText(Tree_f, Tree_TreeRoot->U_1.V_26.Ag.EvalCodes->U_1.V_12.Codes.Local);
  624.               Node = Tree_TreeRoot->U_1.V_26.Ag.Modules;
  625.               while (Node->U_1.V_1.Kind == Tree_Module) {
  626.                 TreeMod2_WriteLine(Node->U_1.V_43.Module.EvalCodes->U_1.V_12.Codes.LocalLine);
  627.                 Texts_WriteText(Tree_f, Node->U_1.V_43.Module.EvalCodes->U_1.V_12.Codes.Local);
  628.                 Node = Node->U_1.V_43.Module.Next;
  629.               }
  630.               if (Sets_IsElement(ORD('9'), &Tree_Options)) {
  631.                 IO_WriteS(Tree_f, (STRING)" VAR xxLow: BOOLEAN;", 20L);
  632.                 IO_WriteNl(Tree_f);
  633.                 IO_WriteS(Tree_f, (STRING)" BEGIN", 6L);
  634.                 IO_WriteNl(Tree_f);
  635.                 IO_WriteS(Tree_f, (STRING)"  xxStack := General.Min (xxStack, CARDINAL (SYSTEM.ADR (xxLow)));", 66L);
  636.                 IO_WriteNl(Tree_f);
  637.               } else {
  638.                 IO_WriteS(Tree_f, (STRING)" BEGIN", 6L);
  639.                 IO_WriteNl(Tree_f);
  640.               }
  641.               if (Sets_IsElement(ORD('5'), &Tree_Options)) {
  642.                 IO_WriteS(Tree_f, (STRING)" IFNOTIN (", 10L);
  643.                 Tree_WN((LONGINT)((i - 1) % TreeMod1_BSS));
  644.                 IO_WriteS(Tree_f, (STRING)", yyt^.yyHead.yyIsDone", 22L);
  645.                 Tree_WN((LONGINT)((i - 1) / TreeMod1_BSS));
  646.                 IO_WriteS(Tree_f, (STRING)") INCL (yyt^.yyHead.yyIsDone", 28L);
  647.                 Tree_WN((LONGINT)((i - 1) / TreeMod1_BSS));
  648.                 IO_WriteS(Tree_f, (STRING)", ", 2L);
  649.                 Tree_WN((LONGINT)((i - 1) % TreeMod1_BSS));
  650.                 IO_WriteS(Tree_f, (STRING)"); ELSE yyAbort (yyt); END;", 27L);
  651.                 IO_WriteNl(Tree_f);
  652.               }
  653.               if (n > 1) {
  654.                 IO_WriteS(Tree_f, (STRING)"  CASE yyt^.Kind OF", 19L);
  655.                 IO_WriteNl(Tree_f);
  656.                 Tree_ForallClasses(W_3->Classes, (Tree_ProcOfT)GenS);
  657.                 IO_WriteS(Tree_f, (STRING)"  END;", 6L);
  658.                 IO_WriteNl(Tree_f);
  659.               } else {
  660.                 Tree_ForallClasses(W_3->Classes, (Tree_ProcOfT)GenS);
  661.               }
  662.               IO_WriteS(Tree_f, (STRING)"  INCL (yyt^.yyHead.yyIsComp", 28L);
  663.               Tree_WN((LONGINT)((i - 1) / TreeMod1_BSS));
  664.               IO_WriteS(Tree_f, (STRING)", ", 2L);
  665.               Tree_WN((LONGINT)((i - 1) % TreeMod1_BSS));
  666.               IO_WriteS(Tree_f, (STRING)");", 2L);
  667.               IO_WriteNl(Tree_f);
  668.               IO_WriteS(Tree_f, (STRING)" END yyS", 8L);
  669.               Tree_WN((LONGINT)(i - 1));
  670.               IO_WriteS(Tree_f, (STRING)";", 1L);
  671.               IO_WriteNl(Tree_f);
  672.               IO_WriteNl(Tree_f);
  673.             }
  674.             if (i >= B_6) break;
  675.           }
  676.       }
  677.       {
  678.         SHORTCARD B_7 = Sets_Minimum(&InhIndices), B_8 = Sets_Maximum(&InhIndices);
  679.  
  680.         if (B_7 <= B_8)
  681.           for (i = B_7;; i += 1) {
  682.             if (Sets_IsElement((LONGCARD)i, &InhIndices)) {
  683.               IO_WriteS(Tree_f, (STRING)"PROCEDURE yyI", 13L);
  684.               Tree_WN((LONGINT)i);
  685.               IO_WriteS(Tree_f, (STRING)" (yyt: ", 7L);
  686.               Tree_WI(Tree_iMain);
  687.               IO_WriteS(Tree_f, (STRING)".", 1L);
  688.               Tree_WI(Tree_itTree);
  689.               IO_WriteS(Tree_f, (STRING)");", 2L);
  690.               IO_WriteNl(Tree_f);
  691.               TreeMod2_WriteLine(Tree_TreeRoot->U_1.V_26.Ag.EvalCodes->U_1.V_12.Codes.LocalLine);
  692.               Texts_WriteText(Tree_f, Tree_TreeRoot->U_1.V_26.Ag.EvalCodes->U_1.V_12.Codes.Local);
  693.               Node = Tree_TreeRoot->U_1.V_26.Ag.Modules;
  694.               while (Node->U_1.V_1.Kind == Tree_Module) {
  695.                 TreeMod2_WriteLine(Node->U_1.V_43.Module.EvalCodes->U_1.V_12.Codes.LocalLine);
  696.                 Texts_WriteText(Tree_f, Node->U_1.V_43.Module.EvalCodes->U_1.V_12.Codes.Local);
  697.                 Node = Node->U_1.V_43.Module.Next;
  698.               }
  699.               if (Sets_IsElement(ORD('9'), &Tree_Options)) {
  700.                 IO_WriteS(Tree_f, (STRING)" VAR xxLow: BOOLEAN;", 20L);
  701.                 IO_WriteNl(Tree_f);
  702.                 IO_WriteS(Tree_f, (STRING)" BEGIN", 6L);
  703.                 IO_WriteNl(Tree_f);
  704.                 IO_WriteS(Tree_f, (STRING)"  xxStack := General.Min (xxStack, CARDINAL (SYSTEM.ADR (xxLow)));", 66L);
  705.                 IO_WriteNl(Tree_f);
  706.               } else {
  707.                 IO_WriteS(Tree_f, (STRING)" BEGIN", 6L);
  708.                 IO_WriteNl(Tree_f);
  709.               }
  710.               Check = 0;
  711.               if (InhIndexCount->A[i - 1] > 1) {
  712.                 IO_WriteS(Tree_f, (STRING)"  CASE yyt^.Kind OF", 19L);
  713.                 IO_WriteNl(Tree_f);
  714.                 Tree_ForallClasses(W_3->Classes, (Tree_ProcOfT)EvalMod3_EvalImplMod);
  715.                 IO_WriteS(Tree_f, (STRING)"  END;", 6L);
  716.                 IO_WriteNl(Tree_f);
  717.               } else {
  718.                 Tree_ForallClasses(W_3->Classes, (Tree_ProcOfT)EvalMod3_EvalImplMod);
  719.               }
  720.               if (Check != InhIndexCount->A[i - 1]) {
  721.                 Errors_MessageI((STRING)"internal error in yyI", 21L, (LONGCARD)Errors_Error, Positions_NoPosition, (LONGCARD)Errors_Short, ADR(i));
  722.               }
  723.               IO_WriteS(Tree_f, (STRING)" END yyI", 8L);
  724.               Tree_WN((LONGINT)i);
  725.               IO_WriteS(Tree_f, (STRING)";", 1L);
  726.               IO_WriteNl(Tree_f);
  727.               IO_WriteNl(Tree_f);
  728.             }
  729.             if (i >= B_8) break;
  730.           }
  731.       }
  732.       IO_WriteS(Tree_f, (STRING)"PROCEDURE Begin", 15L);
  733.       Tree_WI(W_3->EvalName);
  734.       IO_WriteS(Tree_f, (STRING)";", 1L);
  735.       IO_WriteNl(Tree_f);
  736.       IO_WriteS(Tree_f, (STRING)" BEGIN", 6L);
  737.       IO_WriteNl(Tree_f);
  738.       TreeMod2_WriteLine(W_3->EvalCodes->U_1.V_12.Codes.BeginLine);
  739.       Texts_WriteText(Tree_f, W_3->EvalCodes->U_1.V_12.Codes.Begin);
  740.       Node = W_3->Modules;
  741.       while (Node->U_1.V_1.Kind == Tree_Module) {
  742.         TreeMod2_WriteLine(Node->U_1.V_43.Module.EvalCodes->U_1.V_12.Codes.BeginLine);
  743.         Texts_WriteText(Tree_f, Node->U_1.V_43.Module.EvalCodes->U_1.V_12.Codes.Begin);
  744.         Node = Node->U_1.V_43.Module.Next;
  745.       }
  746.       IO_WriteS(Tree_f, (STRING)" END Begin", 10L);
  747.       Tree_WI(W_3->EvalName);
  748.       IO_WriteS(Tree_f, (STRING)";", 1L);
  749.       IO_WriteNl(Tree_f);
  750.       IO_WriteNl(Tree_f);
  751.       IO_WriteS(Tree_f, (STRING)"PROCEDURE Close", 15L);
  752.       Tree_WI(W_3->EvalName);
  753.       IO_WriteS(Tree_f, (STRING)";", 1L);
  754.       IO_WriteNl(Tree_f);
  755.       IO_WriteS(Tree_f, (STRING)" BEGIN", 6L);
  756.       IO_WriteNl(Tree_f);
  757.       TreeMod2_WriteLine(W_3->EvalCodes->U_1.V_12.Codes.CloseLine);
  758.       Texts_WriteText(Tree_f, W_3->EvalCodes->U_1.V_12.Codes.Close);
  759.       Node = W_3->Modules;
  760.       while (Node->U_1.V_1.Kind == Tree_Module) {
  761.         TreeMod2_WriteLine(Node->U_1.V_43.Module.EvalCodes->U_1.V_12.Codes.CloseLine);
  762.         Texts_WriteText(Tree_f, Node->U_1.V_43.Module.EvalCodes->U_1.V_12.Codes.Close);
  763.         Node = Node->U_1.V_43.Module.Next;
  764.       }
  765.       IO_WriteS(Tree_f, (STRING)" END Close", 10L);
  766.       Tree_WI(W_3->EvalName);
  767.       IO_WriteS(Tree_f, (STRING)";", 1L);
  768.       IO_WriteNl(Tree_f);
  769.       IO_WriteNl(Tree_f);
  770.       IO_WriteS(Tree_f, (STRING)"BEGIN", 5L);
  771.       IO_WriteNl(Tree_f);
  772.       if (Sets_IsElement(ORD('X'), &Tree_Options)) {
  773.         IO_WriteS(Tree_f, (STRING)" yyf := IO.StdOutput;", 21L);
  774.         IO_WriteNl(Tree_f);
  775.       }
  776.       {
  777.         SHORTCARD B_9 = Sets_Minimum(&InhIndices), B_10 = Sets_Maximum(&InhIndices);
  778.  
  779.         if (B_9 <= B_10)
  780.           for (i = B_9;; i += 1) {
  781.             if (Sets_IsElement((LONGCARD)i, &InhIndices)) {
  782.               IO_WriteS(Tree_f, (STRING)" yyI [", 6L);
  783.               Tree_WN((LONGINT)i);
  784.               IO_WriteS(Tree_f, (STRING)"] := yyI", 8L);
  785.               Tree_WN((LONGINT)i);
  786.               IO_WriteS(Tree_f, (STRING)";", 1L);
  787.               IO_WriteNl(Tree_f);
  788.             }
  789.             if (i >= B_10) break;
  790.           }
  791.       }
  792.       IO_WriteS(Tree_f, (STRING)"END ", 4L);
  793.       Tree_WI(W_3->EvalName);
  794.       IO_WriteS(Tree_f, (STRING)".", 1L);
  795.       IO_WriteNl(Tree_f);
  796.       return;
  797.     }
  798.   }
  799.   if (t->U_1.V_1.Kind == Tree_Class) {
  800.     {
  801.       register struct S_5 *W_4 = &yyTempo.U_1.V_1.yyR2;
  802.  
  803.       for (;;) {
  804.         {
  805.           register Tree_yClass *W_5 = &t->U_1.V_5.Class;
  806.  
  807.           if (!((Tree_NoCodeClass & W_5->Properties) == 0X0L)) {
  808.             goto EXIT_1;
  809.           }
  810.           if (!(i <= W_5->InstCount)) {
  811.             goto EXIT_1;
  812.           }
  813.           W_4->a = ToAttr(t, (LONGINT)i);
  814.           if (W_4->a == 0) {
  815.             return;
  816.           }
  817.           {
  818.             register Tree_tInstance *W_6 = &W_5->Instance->A[W_4->a - 1];
  819.  
  820.             if (SET_IS_SUBSET1(SET_ELEM(Tree_Inherited) | SET_ELEM(Tree_Right), W_6->Properties)) {
  821.               EvalMod_Class = t;
  822.               if (InhIndexCount->A[i - 1] > 1) {
  823.                 IO_WriteS(Tree_f, (STRING)"   | ", 5L);
  824.                 Tree_WI(Tree_iMain);
  825.                 IO_WriteS(Tree_f, (STRING)".", 1L);
  826.                 Tree_WI(W_5->Name);
  827.                 IO_WriteS(Tree_f, (STRING)":", 1L);
  828.                 IO_WriteNl(Tree_f);
  829.               }
  830.               INC(Check);
  831.               k = ToBit1(W_6->Selector, (LONGINT)(W_4->a - W_5->AttrCount - W_6->Selector->U_1.V_9.Child.InstOffset));
  832.               if (Sets_IsElement(ORD('5'), &Tree_Options)) {
  833.                 IO_WriteS(Tree_f, (STRING)" IFNOTIN (", 10L);
  834.                 Tree_WN((LONGINT)(k % TreeMod1_BSS));
  835.                 IO_WriteS(Tree_f, (STRING)", yyt^.", 7L);
  836.                 Tree_WI(EvalMod_Class->U_1.V_5.Class.Name);
  837.                 IO_WriteS(Tree_f, (STRING)".", 1L);
  838.                 Tree_WI(W_6->Selector->U_1.V_9.Child.Name);
  839.                 IO_WriteS(Tree_f, (STRING)"^.yyHead.yyIsDone", 17L);
  840.                 Tree_WN((LONGINT)(k / TreeMod1_BSS));
  841.                 IO_WriteS(Tree_f, (STRING)") INCL (yyt^.", 13L);
  842.                 Tree_WI(EvalMod_Class->U_1.V_5.Class.Name);
  843.                 IO_WriteS(Tree_f, (STRING)".", 1L);
  844.                 Tree_WI(W_6->Selector->U_1.V_9.Child.Name);
  845.                 IO_WriteS(Tree_f, (STRING)"^.yyHead.yyIsDone", 17L);
  846.                 Tree_WN((LONGINT)(k / TreeMod1_BSS));
  847.                 IO_WriteS(Tree_f, (STRING)", ", 2L);
  848.                 Tree_WN((LONGINT)(k % TreeMod1_BSS));
  849.                 IO_WriteS(Tree_f, (STRING)"); ELSE yyAbort (yyt); END;", 27L);
  850.                 IO_WriteNl(Tree_f);
  851.               }
  852.               {
  853.                 SHORTCARD B_11 = 1, B_12 = W_5->InstCount;
  854.  
  855.                 if (B_11 <= B_12)
  856.                   for (j = B_11;; j += 1) {
  857.                     if (Relations_IsRelated((LONGINT)W_4->a, (LONGINT)j, W_5->DP)) {
  858.                       GenCall(t, j);
  859.                     }
  860.                     if (j >= B_12) break;
  861.                   }
  862.               }
  863.               if (Sets_IsElement(ORD('X'), &Tree_Options) && IN(Tree_Trace, t->U_1.V_5.Class.Properties)) {
  864.                 IO_WriteS(Tree_f, (STRING)"yyWriteEval (yyt, \"", 19L);
  865.                 Tree_WI(W_6->Selector->U_1.V_9.Child.Name);
  866.                 IO_WriteS(Tree_f, (STRING)":", 1L);
  867.                 Tree_WI(W_6->Attribute->U_1.V_9.Child.Name);
  868.                 IO_WriteS(Tree_f, (STRING)"\");", 3L);
  869.                 IO_WriteNl(Tree_f);
  870.                 if (W_6->Action != ADR(W_6->Action) && !IN(Tree_Virtual, W_6->Properties)) {
  871.                   GenEvaluator(W_6->Action);
  872.                   EvalMod_GenEvaluator(W_6->Action);
  873.                   IO_WriteNl(Tree_f);
  874.                   if (W_6->Attribute->U_1.V_1.Kind == Tree_Child || W_6->Attribute->U_1.V_10.Attribute.Type == Tree_itTree) {
  875.                     IO_WriteS(Tree_f, (STRING)"write", 5L);
  876.                     Tree_WI(Tree_itTree);
  877.                     IO_WriteS(Tree_f, (STRING)" (yyt^.", 7L);
  878.                     Tree_WI(W_5->Name);
  879.                     IO_WriteS(Tree_f, (STRING)".", 1L);
  880.                     Tree_WI(W_6->Selector->U_1.V_9.Child.Name);
  881.                     IO_WriteS(Tree_f, (STRING)"^.", 2L);
  882.                     Tree_WI(W_6->Selector->U_1.V_9.Child.Type);
  883.                     IO_WriteS(Tree_f, (STRING)".", 1L);
  884.                     Tree_WI(W_6->Attribute->U_1.V_9.Child.Name);
  885.                     IO_WriteS(Tree_f, (STRING)")", 1L);
  886.                     IO_WriteNl(Tree_f);
  887.                   } else {
  888.                     IO_WriteS(Tree_f, (STRING)"write", 5L);
  889.                     Tree_WI(W_6->Attribute->U_1.V_9.Child.Type);
  890.                     IO_WriteS(Tree_f, (STRING)" (yyt^.", 7L);
  891.                     Tree_WI(W_5->Name);
  892.                     IO_WriteS(Tree_f, (STRING)".", 1L);
  893.                     Tree_WI(W_6->Selector->U_1.V_9.Child.Name);
  894.                     IO_WriteS(Tree_f, (STRING)"^.", 2L);
  895.                     Tree_WI(W_6->Selector->U_1.V_9.Child.Type);
  896.                     IO_WriteS(Tree_f, (STRING)".", 1L);
  897.                     Tree_WI(W_6->Attribute->U_1.V_9.Child.Name);
  898.                     IO_WriteS(Tree_f, (STRING)") yyWriteNl;", 12L);
  899.                     IO_WriteNl(Tree_f);
  900.                   }
  901.                 } else {
  902.                   IO_WriteS(Tree_f, (STRING)"yyWriteNl;", 10L);
  903.                   IO_WriteNl(Tree_f);
  904.                 }
  905.               } else if (Sets_IsElement(ORD('Y'), &Tree_Options) && IN(Tree_Trace, t->U_1.V_5.Class.Properties)) {
  906.                 IO_WriteS(Tree_f, (STRING)"yyWriteEval (yyt, \"", 19L);
  907.                 Tree_WI(W_6->Selector->U_1.V_9.Child.Name);
  908.                 IO_WriteS(Tree_f, (STRING)":", 1L);
  909.                 Tree_WI(W_6->Attribute->U_1.V_9.Child.Name);
  910.                 IO_WriteS(Tree_f, (STRING)"\");", 3L);
  911.                 IO_WriteNl(Tree_f);
  912.                 if (W_6->Action != ADR(W_6->Action) && !IN(Tree_Virtual, W_6->Properties)) {
  913.                   GenEvaluator(W_6->Action);
  914.                   EvalMod_GenEvaluator(W_6->Action);
  915.                 }
  916.               } else {
  917.                 if (W_6->Action != ADR(W_6->Action) && !IN(Tree_Virtual, W_6->Properties)) {
  918.                   GenEvaluator(W_6->Action);
  919.                   EvalMod_GenEvaluator(W_6->Action);
  920.                 }
  921.               }
  922.               if (!IN(Tree_Input, W_6->Properties) && W_6->Attribute->U_1.V_1.Kind == Tree_Child) {
  923.                 IO_WriteS(Tree_f, (STRING)"WITH yyt^.", 10L);
  924.                 Tree_WI(W_5->Name);
  925.                 IO_WriteS(Tree_f, (STRING)".", 1L);
  926.                 Tree_WI(W_6->Selector->U_1.V_9.Child.Name);
  927.                 IO_WriteS(Tree_f, (STRING)"^.", 2L);
  928.                 Tree_WI(W_6->Selector->U_1.V_9.Child.Type);
  929.                 IO_WriteS(Tree_f, (STRING)".", 1L);
  930.                 Tree_WI(W_6->Attribute->U_1.V_9.Child.Name);
  931.                 IO_WriteS(Tree_f, (STRING)"^.yyHead DO IF yyParent = ", 26L);
  932.                 Tree_WI(Tree_iMain);
  933.                 IO_WriteS(Tree_f, (STRING)".", 1L);
  934.                 Tree_WI(Tree_iNoTree);
  935.                 IO_WriteS(Tree_f, (STRING)" THEN yyOffset := ", 18L);
  936.                 Tree_WN((LONGINT)(W_6->Selector->U_1.V_9.Child.Class->U_1.V_5.Class.BitCount + W_6->Attribute->U_1.V_9.Child.BitOffset));
  937.                 IO_WriteS(Tree_f, (STRING)"; yyParent := yyt^.", 19L);
  938.                 Tree_WI(W_5->Name);
  939.                 IO_WriteS(Tree_f, (STRING)".", 1L);
  940.                 Tree_WI(W_6->Selector->U_1.V_9.Child.Name);
  941.                 IO_WriteS(Tree_f, (STRING)"; ", 2L);
  942.                 IO_WriteNl(Tree_f);
  943.                 Tree_WI(Tree_iMain);
  944.                 IO_WriteS(Tree_f, (STRING)".Init", 5L);
  945.                 Tree_WI(Tree_iModule);
  946.                 IO_WriteS(Tree_f, (STRING)" (yyt^.", 7L);
  947.                 Tree_WI(W_5->Name);
  948.                 IO_WriteS(Tree_f, (STRING)".", 1L);
  949.                 Tree_WI(W_6->Selector->U_1.V_9.Child.Name);
  950.                 IO_WriteS(Tree_f, (STRING)"^.", 2L);
  951.                 Tree_WI(W_6->Selector->U_1.V_9.Child.Type);
  952.                 IO_WriteS(Tree_f, (STRING)".", 1L);
  953.                 Tree_WI(W_6->Attribute->U_1.V_9.Child.Name);
  954.                 IO_WriteS(Tree_f, (STRING)"); END; END;", 12L);
  955.                 IO_WriteNl(Tree_f);
  956.               }
  957.               {
  958.                 SHORTCARD B_13 = 1, B_14 = W_5->InstCount;
  959.  
  960.                 if (B_13 <= B_14)
  961.                   for (i2 = B_13;; i2 += 1) {
  962.                     if (W_5->Instance->A[i2 - 1].Action == W_6->Action) {
  963.                       {
  964.                         register Tree_tInstance *W_7 = &W_5->Instance->A[i2 - 1];
  965.  
  966.                         if (IN(Tree_Synthesized, W_7->Properties)) {
  967.                           k = EvalMod3_ToBit0(EvalMod_Class, (LONGINT)i2);
  968.                           IO_WriteS(Tree_f, (STRING)"   INCL (yyt^.yyHead.yyIsComp", 29L);
  969.                           Tree_WN((LONGINT)(k / TreeMod1_BSS));
  970.                           IO_WriteS(Tree_f, (STRING)", ", 2L);
  971.                           Tree_WN((LONGINT)(k % TreeMod1_BSS));
  972.                           IO_WriteS(Tree_f, (STRING)");", 2L);
  973.                           IO_WriteNl(Tree_f);
  974.                         } else if (IN(Tree_Inherited, W_7->Properties)) {
  975.                           k = ToBit1(W_7->Selector, (LONGINT)(i2 - W_5->AttrCount - W_7->Selector->U_1.V_9.Child.InstOffset));
  976.                           IO_WriteS(Tree_f, (STRING)"   INCL (yyt^.", 14L);
  977.                           Tree_WI(EvalMod_Class->U_1.V_5.Class.Name);
  978.                           IO_WriteS(Tree_f, (STRING)".", 1L);
  979.                           Tree_WI(W_7->Selector->U_1.V_9.Child.Name);
  980.                           IO_WriteS(Tree_f, (STRING)"^.yyHead.yyIsComp", 17L);
  981.                           Tree_WN((LONGINT)(k / TreeMod1_BSS));
  982.                           IO_WriteS(Tree_f, (STRING)", ", 2L);
  983.                           Tree_WN((LONGINT)(k % TreeMod1_BSS));
  984.                           IO_WriteS(Tree_f, (STRING)");", 2L);
  985.                           IO_WriteNl(Tree_f);
  986.                         }
  987.                       }
  988.                     }
  989.                     if (i2 >= B_14) break;
  990.                   }
  991.               }
  992.             }
  993.           }
  994.           return;
  995.         }
  996.       } EXIT_1:;
  997.     }
  998.   }
  999. }
  1000.  
  1001. static void CompBitInfo
  1002. # ifdef __STDC__
  1003. (Tree_tTree t)
  1004. # else
  1005. (t)
  1006. Tree_tTree t;
  1007. # endif
  1008. {
  1009.   struct S_6 yyTempo;
  1010.  
  1011.   if (t == Tree_NoTree) {
  1012.     return;
  1013.   }
  1014.   if (t->U_1.V_1.Kind == Tree_Class) {
  1015.     {
  1016.       register Tree_yClass *W_8 = &t->U_1.V_5.Class;
  1017.  
  1018.       BitIndexSize = W_8->AttrCount;
  1019.       DynArray_MakeArray((ADDRESS *)&W_8->BitIndex, &BitIndexSize, (LONGINT)sizeof(Tree_tBitInfo));
  1020.       i = 1;
  1021.       gBitIndex = W_8->BitIndex;
  1022.       Tree_ForallAttributes(t, (Tree_ProcOfT)CompBitInfo);
  1023.       MaxBit = General_Max((LONGINT)i, (LONGINT)MaxBit);
  1024.       MaxInstCount = General_Max((LONGINT)W_8->InstCount, (LONGINT)MaxInstCount);
  1025.       return;
  1026.     }
  1027.   }
  1028.   if (t->U_1.V_1.Kind == Tree_Child) {
  1029.     for (;;) {
  1030.       {
  1031.         register Tree_yChild *W_9 = &t->U_1.V_9.Child;
  1032.  
  1033.         if (!(((SET_ELEM(Tree_Input) | SET_ELEM(Tree_Test) | SET_ELEM(Tree_Dummy)) & W_9->Properties) == 0X0L)) {
  1034.           goto EXIT_2;
  1035.         }
  1036.         INC(i);
  1037.         gBitIndex->A[W_9->AttrIndex - 1].ToBit = i;
  1038.         gBitIndex->A[i - 1].ToAttr = W_9->AttrIndex;
  1039.         return;
  1040.       }
  1041.     } EXIT_2:;
  1042.   }
  1043.   if (t->U_1.V_1.Kind == Tree_Attribute) {
  1044.     for (;;) {
  1045.       {
  1046.         register Tree_yAttribute *W_10 = &t->U_1.V_10.Attribute;
  1047.  
  1048.         if (!(((SET_ELEM(Tree_Input) | SET_ELEM(Tree_Test) | SET_ELEM(Tree_Dummy)) & W_10->Properties) == 0X0L)) {
  1049.           goto EXIT_3;
  1050.         }
  1051.         INC(i);
  1052.         gBitIndex->A[W_10->AttrIndex - 1].ToBit = i;
  1053.         gBitIndex->A[i - 1].ToAttr = W_10->AttrIndex;
  1054.         return;
  1055.       }
  1056.     } EXIT_3:;
  1057.   }
  1058. }
  1059.  
  1060. static void CompInhIndices
  1061. # ifdef __STDC__
  1062. (Tree_tTree t)
  1063. # else
  1064. (t)
  1065. Tree_tTree t;
  1066. # endif
  1067. {
  1068.   struct S_7 yyTempo;
  1069.  
  1070.   if (t == Tree_NoTree) {
  1071.     return;
  1072.   }
  1073.   if (t->U_1.V_1.Kind == Tree_Class) {
  1074.     {
  1075.       register struct S_8 *W_11 = &yyTempo.U_1.V_1.yyR1;
  1076.  
  1077.       {
  1078.         register Tree_yClass *W_12 = &t->U_1.V_5.Class;
  1079.  
  1080.         {
  1081.           SHORTCARD B_15 = W_12->AttrCount + 1, B_16 = W_12->InstCount;
  1082.  
  1083.           if (B_15 <= B_16)
  1084.             for (j = B_15;; j += 1) {
  1085.               {
  1086.                 register Tree_tInstance *W_13 = &W_12->Instance->A[j - 1];
  1087.  
  1088.                 if (IN(Tree_Inherited, W_13->Properties)) {
  1089.                   W_11->b = ToBit2(t, W_13->Selector, j);
  1090.                   Sets_Include(&InhIndices, (LONGCARD)W_11->b);
  1091.                   INC(InhIndexCount->A[W_11->b - 1]);
  1092.                 }
  1093.               }
  1094.               if (j >= B_16) break;
  1095.             }
  1096.         }
  1097.         return;
  1098.       }
  1099.     }
  1100.   }
  1101. }
  1102.  
  1103. static void CountSynAttr
  1104. # ifdef __STDC__
  1105. (Tree_tTree t)
  1106. # else
  1107. (t)
  1108. Tree_tTree t;
  1109. # endif
  1110. {
  1111.   struct S_9 yyTempo;
  1112.  
  1113.   if (t == Tree_NoTree) {
  1114.     return;
  1115.   }
  1116.   if (t->U_1.V_1.Kind == Tree_Class) {
  1117.     for (;;) {
  1118.       {
  1119.         register Tree_yClass *W_14 = &t->U_1.V_5.Class;
  1120.  
  1121.         if (!((Tree_NoCodeClass & W_14->Properties) == 0X0L)) {
  1122.           goto EXIT_4;
  1123.         }
  1124.         if (!(i <= W_14->BitCount)) {
  1125.           goto EXIT_4;
  1126.         }
  1127.         {
  1128.           register Tree_tInstance *W_15 = &W_14->Instance->A[W_14->BitIndex->A[i - 1].ToAttr - 1];
  1129.  
  1130.           if (SET_IS_SUBSET1(SET_ELEM(Tree_Synthesized) | SET_ELEM(Tree_Left), W_15->Properties) && !IN(Tree_Test, W_15->Properties)) {
  1131.             INC(n);
  1132.           }
  1133.         }
  1134.         return;
  1135.       }
  1136.     } EXIT_4:;
  1137.   }
  1138. }
  1139.  
  1140. static void WriteType
  1141. # ifdef __STDC__
  1142. (Tree_tTree t)
  1143. # else
  1144. (t)
  1145. Tree_tTree t;
  1146. # endif
  1147. {
  1148.   struct S_10 yyTempo;
  1149.  
  1150.   if (t == Tree_NoTree) {
  1151.     return;
  1152.   }
  1153.   if (t->U_1.V_1.Kind == Tree_Class) {
  1154.     for (;;) {
  1155.       {
  1156.         register Tree_yClass *W_16 = &t->U_1.V_5.Class;
  1157.  
  1158.         if (!((Tree_NoCodeClass & W_16->Properties) == 0X0L)) {
  1159.           goto EXIT_5;
  1160.         }
  1161.         if (!IN(Tree_Trace, W_16->Properties)) {
  1162.           goto EXIT_5;
  1163.         }
  1164.         IO_WriteS(Tree_f, (STRING)"| ", 2L);
  1165.         Tree_WI(Tree_TreeRoot->U_1.V_26.Ag.TreeName);
  1166.         IO_WriteS(Tree_f, (STRING)".", 1L);
  1167.         Tree_WI(W_16->Name);
  1168.         IO_WriteS(Tree_f, (STRING)": yyWriteS ('", 13L);
  1169.         Tree_WI(W_16->Name);
  1170.         IO_WriteS(Tree_f, (STRING)"');", 3L);
  1171.         IO_WriteNl(Tree_f);
  1172.         return;
  1173.       }
  1174.     } EXIT_5:;
  1175.   }
  1176. }
  1177.  
  1178. static void GenS
  1179. # ifdef __STDC__
  1180. (Tree_tTree t)
  1181. # else
  1182. (t)
  1183. Tree_tTree t;
  1184. # endif
  1185. {
  1186.   struct S_11 yyTempo;
  1187.  
  1188.   if (t == Tree_NoTree) {
  1189.     return;
  1190.   }
  1191.   if (t->U_1.V_1.Kind == Tree_Class) {
  1192.     for (;;) {
  1193.       {
  1194.         register Tree_yClass *W_17 = &t->U_1.V_5.Class;
  1195.  
  1196.         if (!((Tree_NoCodeClass & W_17->Properties) == 0X0L)) {
  1197.           goto EXIT_6;
  1198.         }
  1199.         if (!(i <= W_17->BitCount)) {
  1200.           goto EXIT_6;
  1201.         }
  1202.         {
  1203.           register Tree_tInstance *W_18 = &W_17->Instance->A[W_17->BitIndex->A[i - 1].ToAttr - 1];
  1204.  
  1205.           if (SET_IS_SUBSET1(SET_ELEM(Tree_Synthesized) | SET_ELEM(Tree_Left), W_18->Properties) && !IN(Tree_Test, W_18->Properties)) {
  1206.             EvalMod_Class = t;
  1207.             if (n > 1) {
  1208.               IO_WriteS(Tree_f, (STRING)"   | ", 5L);
  1209.               Tree_WI(Tree_iMain);
  1210.               IO_WriteS(Tree_f, (STRING)".", 1L);
  1211.               Tree_WI(W_17->Name);
  1212.               IO_WriteS(Tree_f, (STRING)":", 1L);
  1213.               IO_WriteNl(Tree_f);
  1214.             }
  1215.             {
  1216.               SHORTCARD B_17 = 1, B_18 = W_17->InstCount;
  1217.  
  1218.               if (B_17 <= B_18)
  1219.                 for (j = B_17;; j += 1) {
  1220.                   if (Relations_IsRelated((LONGINT)W_17->BitIndex->A[i - 1].ToAttr, (LONGINT)j, W_17->DP)) {
  1221.                     GenCall(t, j);
  1222.                   }
  1223.                   if (j >= B_18) break;
  1224.                 }
  1225.             }
  1226.             GenEvalAttr(t, (LONGINT)W_17->BitIndex->A[i - 1].ToAttr);
  1227.             if (!IN(Tree_Input, W_18->Properties) && W_18->Attribute->U_1.V_1.Kind == Tree_Child) {
  1228.               IO_WriteS(Tree_f, (STRING)"WITH yyt^.", 10L);
  1229.               Tree_WI(W_17->Name);
  1230.               IO_WriteS(Tree_f, (STRING)".", 1L);
  1231.               Tree_WI(W_18->Attribute->U_1.V_9.Child.Name);
  1232.               IO_WriteS(Tree_f, (STRING)"^.yyHead DO IF yyParent = ", 26L);
  1233.               Tree_WI(Tree_iMain);
  1234.               IO_WriteS(Tree_f, (STRING)".", 1L);
  1235.               Tree_WI(Tree_iNoTree);
  1236.               IO_WriteS(Tree_f, (STRING)" THEN yyOffset := ", 18L);
  1237.               Tree_WN((LONGINT)(W_17->BitCount + W_18->Attribute->U_1.V_9.Child.BitOffset));
  1238.               IO_WriteS(Tree_f, (STRING)"; yyParent := yyt; ", 19L);
  1239.               Tree_WI(Tree_iMain);
  1240.               IO_WriteS(Tree_f, (STRING)".Init", 5L);
  1241.               Tree_WI(Tree_iModule);
  1242.               IO_WriteS(Tree_f, (STRING)" (yyt^.", 7L);
  1243.               Tree_WI(W_17->Name);
  1244.               IO_WriteS(Tree_f, (STRING)".", 1L);
  1245.               Tree_WI(W_18->Attribute->U_1.V_9.Child.Name);
  1246.               IO_WriteS(Tree_f, (STRING)"); END; END;", 12L);
  1247.               IO_WriteNl(Tree_f);
  1248.             }
  1249.             {
  1250.               SHORTCARD B_19 = 1, B_20 = W_17->InstCount;
  1251.  
  1252.               if (B_19 <= B_20)
  1253.                 for (i2 = B_19;; i2 += 1) {
  1254.                   if (W_17->Instance->A[i2 - 1].Action == W_18->Action) {
  1255.                     {
  1256.                       register Tree_tInstance *W_19 = &W_17->Instance->A[i2 - 1];
  1257.  
  1258.                       if (IN(Tree_Synthesized, W_19->Properties)) {
  1259.                         k = EvalMod3_ToBit0(EvalMod_Class, (LONGINT)i2);
  1260.                         if (k != i - 1) {
  1261.                           IO_WriteS(Tree_f, (STRING)"   INCL (yyt^.yyHead.yyIsComp", 29L);
  1262.                           Tree_WN((LONGINT)(k / TreeMod1_BSS));
  1263.                           IO_WriteS(Tree_f, (STRING)", ", 2L);
  1264.                           Tree_WN((LONGINT)(k % TreeMod1_BSS));
  1265.                           IO_WriteS(Tree_f, (STRING)");", 2L);
  1266.                           IO_WriteNl(Tree_f);
  1267.                         }
  1268.                       } else if (IN(Tree_Inherited, W_19->Properties)) {
  1269.                         k = ToBit1(W_19->Selector, (LONGINT)(i2 - W_17->AttrCount - W_19->Selector->U_1.V_9.Child.InstOffset));
  1270.                         IO_WriteS(Tree_f, (STRING)"   INCL (yyt^.", 14L);
  1271.                         Tree_WI(EvalMod_Class->U_1.V_5.Class.Name);
  1272.                         IO_WriteS(Tree_f, (STRING)".", 1L);
  1273.                         Tree_WI(W_19->Selector->U_1.V_9.Child.Name);
  1274.                         IO_WriteS(Tree_f, (STRING)"^.yyHead.yyIsComp", 17L);
  1275.                         Tree_WN((LONGINT)(k / TreeMod1_BSS));
  1276.                         IO_WriteS(Tree_f, (STRING)", ", 2L);
  1277.                         Tree_WN((LONGINT)(k % TreeMod1_BSS));
  1278.                         IO_WriteS(Tree_f, (STRING)");", 2L);
  1279.                         IO_WriteNl(Tree_f);
  1280.                       }
  1281.                     }
  1282.                   }
  1283.                   if (i2 >= B_20) break;
  1284.                 }
  1285.             }
  1286.           }
  1287.         }
  1288.         return;
  1289.       }
  1290.     } EXIT_6:;
  1291.   }
  1292. }
  1293.  
  1294. static void GenE
  1295. # ifdef __STDC__
  1296. (Tree_tTree t)
  1297. # else
  1298. (t)
  1299. Tree_tTree t;
  1300. # endif
  1301. {
  1302.   struct S_12 yyTempo;
  1303.  
  1304.   if (t == Tree_NoTree) {
  1305.     return;
  1306.   }
  1307.   if (t->U_1.V_1.Kind == Tree_Class) {
  1308.     {
  1309.       register struct S_13 *W_20 = &yyTempo.U_1.V_1.yyR1;
  1310.  
  1311.       {
  1312.         register Tree_yClass *W_21 = &t->U_1.V_5.Class;
  1313.  
  1314.         TreeMod2_GetIterator(t);
  1315.         n = 0;
  1316.         j = 2;
  1317.         for (;;) {
  1318.           if (j > W_21->InstCount) {
  1319.             goto EXIT_7;
  1320.           }
  1321.           {
  1322.             register Tree_tInstance *W_22 = &W_21->Instance->A[j - 1];
  1323.  
  1324.             if (((SET_ELEM(Tree_Dummy) | SET_ELEM(Tree_Output) | SET_ELEM(Tree_Test)) & W_22->Properties) != 0X0L) {
  1325.               if (IN(Tree_Test, W_22->Properties) || SET_IS_SUBSET1(SET_ELEM(Tree_Synthesized) | SET_ELEM(Tree_Left), W_22->Properties) || SET_IS_SUBSET1(SET_ELEM(Tree_Inherited) | SET_ELEM(Tree_Right), W_22->Properties) || SET_IS_SUBSET1(SET_ELEM(Tree_Inherited) | SET_ELEM(Tree_Left), W_22->Properties) && !IN(Tree_Input, W_22->Properties) && W_22->Attribute->U_1.V_1.Kind == Tree_Child || SET_IS_SUBSET1(SET_ELEM(Tree_Synthesized) | SET_ELEM(Tree_Right) | SET_ELEM(Tree_Dummy), W_22->Properties) && W_22->Selector != TreeMod2_Iterator && IN(Tree_HasOutput, W_22->Selector->U_1.V_9.Child.Class->U_1.V_5.Class.Properties)) {
  1326.                 INC(n);
  1327.                 goto EXIT_7;
  1328.               }
  1329.             }
  1330.           }
  1331.           INC(j);
  1332.         } EXIT_7:;
  1333.         if (n == 0 && (TreeMod2_Iterator == Tree_NoTree || !IN(Tree_HasOutput, TreeMod2_Iterator->U_1.V_9.Child.Class->U_1.V_5.Class.Properties))) {
  1334.           return;
  1335.         }
  1336.         EvalMod_Class = t;
  1337.         IO_WriteS(Tree_f, (STRING)"   | ", 5L);
  1338.         Tree_WI(Tree_iMain);
  1339.         IO_WriteS(Tree_f, (STRING)".", 1L);
  1340.         Tree_WI(W_21->Name);
  1341.         IO_WriteS(Tree_f, (STRING)":", 1L);
  1342.         IO_WriteNl(Tree_f);
  1343.         {
  1344.           SHORTCARD B_21 = 2, B_22 = W_21->InstCount;
  1345.  
  1346.           if (B_21 <= B_22)
  1347.             for (j = B_21;; j += 1) {
  1348.               {
  1349.                 register Tree_tInstance *W_23 = &W_21->Instance->A[j - 1];
  1350.  
  1351.                 if (((SET_ELEM(Tree_Dummy) | SET_ELEM(Tree_Output)) & W_23->Properties) != 0X0L) {
  1352.                   if (SET_IS_SUBSET1(SET_ELEM(Tree_Synthesized) | SET_ELEM(Tree_Left), W_23->Properties) || SET_IS_SUBSET1(SET_ELEM(Tree_Inherited) | SET_ELEM(Tree_Right), W_23->Properties) || SET_IS_SUBSET1(SET_ELEM(Tree_Inherited) | SET_ELEM(Tree_Left), W_23->Properties) && !IN(Tree_Input, W_23->Properties) && W_23->Attribute->U_1.V_1.Kind == Tree_Child) {
  1353.                     GenCall(t, j);
  1354.                   } else if (SET_IS_SUBSET1(SET_ELEM(Tree_Synthesized) | SET_ELEM(Tree_Right) | SET_ELEM(Tree_Dummy), W_23->Properties) && W_23->Selector != TreeMod2_Iterator && IN(Tree_HasOutput, W_23->Selector->U_1.V_9.Child.Class->U_1.V_5.Class.Properties)) {
  1355.                     if (Sets_IsElement(ORD('Z'), &Tree_Options) && IN(Tree_Trace, t->U_1.V_5.Class.Properties)) {
  1356.                       IO_WriteS(Tree_f, (STRING)"yyWriteVisit (yyt, '", 20L);
  1357.                       Tree_WI(W_23->Selector->U_1.V_9.Child.Name);
  1358.                       IO_WriteS(Tree_f, (STRING)"'); ", 4L);
  1359.                     }
  1360.                     IO_WriteS(Tree_f, (STRING)"yyE (yyt^.", 10L);
  1361.                     Tree_WI(W_21->Name);
  1362.                     IO_WriteS(Tree_f, (STRING)".", 1L);
  1363.                     Tree_WI(W_23->Selector->U_1.V_9.Child.Name);
  1364.                     IO_WriteS(Tree_f, (STRING)");", 2L);
  1365.                     IO_WriteNl(Tree_f);
  1366.                     if (Sets_IsElement(ORD('Z'), &Tree_Options) && IN(Tree_Trace, t->U_1.V_5.Class.Properties)) {
  1367.                       IO_WriteS(Tree_f, (STRING)"yyVisitParent (yyt^.", 20L);
  1368.                       Tree_WI(W_21->Name);
  1369.                       IO_WriteS(Tree_f, (STRING)".", 1L);
  1370.                       Tree_WI(W_23->Selector->U_1.V_9.Child.Name);
  1371.                       IO_WriteS(Tree_f, (STRING)");", 2L);
  1372.                       IO_WriteNl(Tree_f);
  1373.                     }
  1374.                   }
  1375.                 }
  1376.               }
  1377.               if (j >= B_22) break;
  1378.             }
  1379.         }
  1380.         Sets_MakeSet(&W_20->ToCompute, (LONGCARD)W_21->InstCount);
  1381.         {
  1382.           SHORTCARD B_23 = 2, B_24 = W_21->AttrCount;
  1383.  
  1384.           if (B_23 <= B_24)
  1385.             for (i = B_23;; i += 1) {
  1386.               {
  1387.                 register Tree_tInstance *W_24 = &W_21->Instance->A[i - 1];
  1388.  
  1389.                 if (IN(Tree_Test, W_24->Properties)) {
  1390.                   {
  1391.                     SHORTCARD B_25 = 2, B_26 = W_21->InstCount;
  1392.  
  1393.                     if (B_25 <= B_26)
  1394.                       for (j = B_25;; j += 1) {
  1395.                         if (Relations_IsRelated((LONGINT)i, (LONGINT)j, W_21->DP)) {
  1396.                           if (((SET_ELEM(Tree_Synthesized) | SET_ELEM(Tree_Inherited)) & W_21->Instance->A[j - 1].Properties) != 0X0L) {
  1397.                             Sets_Include(&W_20->ToCompute, (LONGCARD)j);
  1398.                           }
  1399.                         }
  1400.                         if (j >= B_26) break;
  1401.                       }
  1402.                   }
  1403.                 }
  1404.               }
  1405.               if (i >= B_24) break;
  1406.             }
  1407.         }
  1408.         {
  1409.           SHORTCARD B_27 = 2, B_28 = W_21->InstCount;
  1410.  
  1411.           if (B_27 <= B_28)
  1412.             for (i = B_27;; i += 1) {
  1413.               {
  1414.                 register Tree_tInstance *W_25 = &W_21->Instance->A[i - 1];
  1415.  
  1416.                 if (SET_IS_SUBSET1(SET_ELEM(Tree_Synthesized) | SET_ELEM(Tree_Left) | SET_ELEM(Tree_Output), W_25->Properties) || SET_IS_SUBSET1(SET_ELEM(Tree_Inherited) | SET_ELEM(Tree_Right) | SET_ELEM(Tree_Output), W_25->Properties)) {
  1417.                   Sets_Exclude(&W_20->ToCompute, (LONGCARD)i);
  1418.                 }
  1419.               }
  1420.               if (i >= B_28) break;
  1421.             }
  1422.         }
  1423.         while (!Sets_IsEmpty(W_20->ToCompute)) {
  1424.           GenCall(t, (SHORTCARD)Sets_Extract(&W_20->ToCompute));
  1425.         }
  1426.         Sets_ReleaseSet(&W_20->ToCompute);
  1427.         {
  1428.           SHORTCARD B_29 = 2, B_30 = W_21->AttrCount;
  1429.  
  1430.           if (B_29 <= B_30)
  1431.             for (i = B_29;; i += 1) {
  1432.               if (IN(Tree_Test, W_21->Instance->A[i - 1].Properties)) {
  1433.                 GenEvalAttr(t, (LONGINT)i);
  1434.               }
  1435.               if (i >= B_30) break;
  1436.             }
  1437.         }
  1438.         if (TreeMod2_Iterator == Tree_NoTree || !IN(Tree_HasOutput, TreeMod2_Iterator->U_1.V_9.Child.Class->U_1.V_5.Class.Properties)) {
  1439.           IO_WriteS(Tree_f, (STRING)"RETURN;", 7L);
  1440.           IO_WriteNl(Tree_f);
  1441.         } else {
  1442.           if (Sets_IsElement(ORD('Z'), &Tree_Options) && IN(Tree_Trace, t->U_1.V_5.Class.Properties)) {
  1443.             IO_WriteS(Tree_f, (STRING)"yyWriteVisit (yyt, '", 20L);
  1444.             Tree_WI(TreeMod2_Iterator->U_1.V_9.Child.Name);
  1445.             IO_WriteS(Tree_f, (STRING)"'); ", 4L);
  1446.           }
  1447.           IO_WriteS(Tree_f, (STRING)"yyt := yyt^.", 12L);
  1448.           Tree_WI(W_21->Name);
  1449.           IO_WriteS(Tree_f, (STRING)".", 1L);
  1450.           Tree_WI(TreeMod2_Iterator->U_1.V_9.Child.Name);
  1451.           IO_WriteS(Tree_f, (STRING)";", 1L);
  1452.           IO_WriteNl(Tree_f);
  1453.         }
  1454.         return;
  1455.       }
  1456.     }
  1457.   }
  1458. }
  1459.  
  1460. static void CompOutput
  1461. # ifdef __STDC__
  1462. (Tree_tTree t)
  1463. # else
  1464. (t)
  1465. Tree_tTree t;
  1466. # endif
  1467. {
  1468.   struct S_14 yyTempo;
  1469.  
  1470.   if (t == Tree_NoTree) {
  1471.     return;
  1472.   }
  1473.   if (t->U_1.V_1.Kind == Tree_Class) {
  1474.     for (;;) {
  1475.       {
  1476.         register Tree_yClass *W_26 = &t->U_1.V_5.Class;
  1477.  
  1478.         if (!!IN(Tree_HasOutput, W_26->Properties)) {
  1479.           goto EXIT_8;
  1480.         }
  1481.         Success = FALSE;
  1482.         Tree_ForallAttributes(t, (Tree_ProcOfT)CompOutput);
  1483.         Tree_ForallClasses(W_26->Extensions, (Tree_ProcOfT)CompOutput2);
  1484.         if (!Success) {
  1485.           goto EXIT_8;
  1486.         }
  1487.         INCL(W_26->Properties, Tree_HasOutput);
  1488.         IsStable = FALSE;
  1489.         return;
  1490.       }
  1491.     } EXIT_8:;
  1492.   }
  1493.   if (t->U_1.V_1.Kind == Tree_Child) {
  1494.     for (;;) {
  1495.       {
  1496.         register Tree_yChild *W_27 = &t->U_1.V_9.Child;
  1497.  
  1498.         if (!(IN(Tree_Output, W_27->Properties) || IN(Tree_HasOutput, W_27->Class->U_1.V_5.Class.Properties))) {
  1499.           goto EXIT_9;
  1500.         }
  1501.         Success = TRUE;
  1502.         return;
  1503.       }
  1504.     } EXIT_9:;
  1505.   }
  1506.   if (t->U_1.V_1.Kind == Tree_Attribute) {
  1507.     for (;;) {
  1508.       {
  1509.         register Tree_yAttribute *W_28 = &t->U_1.V_10.Attribute;
  1510.  
  1511.         if (!(((SET_ELEM(Tree_Test) | SET_ELEM(Tree_Output)) & W_28->Properties) != 0X0L)) {
  1512.           goto EXIT_10;
  1513.         }
  1514.         Success = TRUE;
  1515.         return;
  1516.       }
  1517.     } EXIT_10:;
  1518.   }
  1519. }
  1520.  
  1521. static void CompOutput2
  1522. # ifdef __STDC__
  1523. (Tree_tTree t)
  1524. # else
  1525. (t)
  1526. Tree_tTree t;
  1527. # endif
  1528. {
  1529.   struct S_15 yyTempo;
  1530.  
  1531.   if (t == Tree_NoTree) {
  1532.     return;
  1533.   }
  1534.   if (t->U_1.V_1.Kind == Tree_Class) {
  1535.     for (;;) {
  1536.       {
  1537.         register Tree_yClass *W_29 = &t->U_1.V_5.Class;
  1538.  
  1539.         if (!IN(Tree_HasOutput, W_29->Properties)) {
  1540.           goto EXIT_11;
  1541.         }
  1542.         Success = TRUE;
  1543.         return;
  1544.       }
  1545.     } EXIT_11:;
  1546.   }
  1547. }
  1548.  
  1549. INTEGER EvalMod3_ToBit0
  1550. # ifdef __STDC__
  1551. (Tree_tTree yyP2, INTEGER yyP1)
  1552. # else
  1553. (yyP2, yyP1)
  1554. Tree_tTree yyP2;
  1555. INTEGER yyP1;
  1556. # endif
  1557. {
  1558.   struct S_16 yyTempo;
  1559.  
  1560.   return yyP2->U_1.V_5.Class.BitIndex->A[yyP1 - 1].ToBit - 1;
  1561. }
  1562.  
  1563. static INTEGER ToBit1
  1564. # ifdef __STDC__
  1565. (Tree_tTree yyP4, INTEGER yyP3)
  1566. # else
  1567. (yyP4, yyP3)
  1568. Tree_tTree yyP4;
  1569. INTEGER yyP3;
  1570. # endif
  1571. {
  1572.   struct S_17 yyTempo;
  1573.  
  1574.   return yyP4->U_1.V_9.Child.Class->U_1.V_5.Class.BitIndex->A[yyP3 - 1].ToBit - 1;
  1575. }
  1576.  
  1577. static INTEGER ToBit2
  1578. # ifdef __STDC__
  1579. (Tree_tTree yyP7, Tree_tTree yyP6, SHORTCARD yyP5)
  1580. # else
  1581. (yyP7, yyP6, yyP5)
  1582. Tree_tTree yyP7;
  1583. Tree_tTree yyP6;
  1584. SHORTCARD yyP5;
  1585. # endif
  1586. {
  1587.   struct S_18 yyTempo;
  1588.  
  1589.   {
  1590.     register struct S_19 *W_30 = &yyTempo.U_1.V_1.yyR1;
  1591.  
  1592.     {
  1593.       register Tree_yChild *W_31 = &yyP6->U_1.V_9.Child;
  1594.  
  1595.       return yyP7->U_1.V_5.Class.BitCount + W_31->BitOffset + W_31->Class->U_1.V_5.Class.BitIndex->A[yyP5 - yyP7->U_1.V_5.Class.AttrCount - W_31->InstOffset - 1].ToBit - 1;
  1596.     }
  1597.     return W_30->yyV1;
  1598.   }
  1599. }
  1600.  
  1601. static INTEGER ToAttr
  1602. # ifdef __STDC__
  1603. (Tree_tTree yyP9, INTEGER yyP8)
  1604. # else
  1605. (yyP9, yyP8)
  1606. Tree_tTree yyP9;
  1607. INTEGER yyP8;
  1608. # endif
  1609. {
  1610.   SHORTCARD a;
  1611.   struct S_20 yyTempo;
  1612.  
  1613.   {
  1614.     register struct S_21 *W_32 = &yyTempo.U_1.V_1.yyR1;
  1615.  
  1616.     {
  1617.       register Tree_yClass *W_33 = &yyP9->U_1.V_5.Class;
  1618.  
  1619.       {
  1620.         SHORTCARD B_31 = W_33->AttrCount + 1, B_32 = W_33->InstCount;
  1621.  
  1622.         if (B_31 <= B_32)
  1623.           for (a = B_31;; a += 1) {
  1624.             {
  1625.               register Tree_tInstance *W_34 = &W_33->Instance->A[a - 1];
  1626.  
  1627.               if (((SET_ELEM(Tree_Input) | SET_ELEM(Tree_Test) | SET_ELEM(Tree_Dummy)) & W_34->Properties) == 0X0L && ToBit2(yyP9, W_34->Selector, a) == yyP8) {
  1628.                 return a;
  1629.               }
  1630.             }
  1631.             if (a >= B_32) break;
  1632.           }
  1633.       }
  1634.     }
  1635.     return 0;
  1636.     return W_32->yyV1;
  1637.   }
  1638. }
  1639.  
  1640. static void GenEvaluator
  1641. # ifdef __STDC__
  1642. (Tree_tTree t)
  1643. # else
  1644. (t)
  1645. Tree_tTree t;
  1646. # endif
  1647. {
  1648.   struct S_22 yyTempo;
  1649.  
  1650.   if (t == Tree_NoTree) {
  1651.     return;
  1652.   }
  1653.   switch (t->U_1.V_1.Kind) {
  1654.   case Tree_Assign:;
  1655.     {
  1656.       register Tree_yAssign *W_35 = &t->U_1.V_36.Assign;
  1657.  
  1658.       GenEvaluator(W_35->Arguments);
  1659.       return;
  1660.     }
  1661.     break;
  1662.   case Tree_Copy:;
  1663.     {
  1664.       register Tree_yCopy *W_36 = &t->U_1.V_37.Copy;
  1665.  
  1666.       GenEvaluator(W_36->Arguments);
  1667.       return;
  1668.     }
  1669.     break;
  1670.   case Tree_TargetCode:;
  1671.     {
  1672.       register Tree_yTargetCode *W_37 = &t->U_1.V_38.TargetCode;
  1673.  
  1674.       GenEvaluator(W_37->Code);
  1675.       return;
  1676.     }
  1677.     break;
  1678.   case Tree_Check:;
  1679.     {
  1680.       register Tree_yCheck *W_38 = &t->U_1.V_40.Check;
  1681.  
  1682.       GenEvaluator(W_38->Condition);
  1683.       GenEvaluator(W_38->Statement);
  1684.       GenEvaluator(W_38->Actions);
  1685.       return;
  1686.     }
  1687.     break;
  1688.   case Tree_Designator:;
  1689.     {
  1690.       register Tree_yDesignator *W_39 = &t->U_1.V_15.Designator;
  1691.  
  1692.       GenEvaluator(W_39->Next);
  1693.       return;
  1694.     }
  1695.     break;
  1696.   case Tree_Ident:;
  1697.     {
  1698.       register Tree_yIdent *W_40 = &t->U_1.V_16.Ident;
  1699.  
  1700.       GenEvaluator(W_40->Next);
  1701.       return;
  1702.     }
  1703.     break;
  1704.   case Tree_Any:;
  1705.     {
  1706.       register Tree_yAny *W_41 = &t->U_1.V_18.Any;
  1707.  
  1708.       GenEvaluator(W_41->Next);
  1709.       return;
  1710.     }
  1711.     break;
  1712.   case Tree_Anys:;
  1713.     {
  1714.       register Tree_yAnys *W_42 = &t->U_1.V_19.Anys;
  1715.  
  1716.       GenEvaluator(W_42->Next);
  1717.       return;
  1718.     }
  1719.     break;
  1720.   case Tree_Remote:;
  1721.     {
  1722.       register struct S_23 *W_43 = &yyTempo.U_1.V_1.yyR9;
  1723.  
  1724.       {
  1725.         register Tree_yRemote *W_44 = &t->U_1.V_17.Remote;
  1726.  
  1727.         W_43->TheClass = Tree_IdentifyClass(Tree_TreeRoot->U_1.V_26.Ag.Classes, W_44->Type);
  1728.         if (W_43->TheClass != Tree_NoTree) {
  1729.           Attr = Tree_IdentifyAttribute(W_43->TheClass, W_44->Attribute);
  1730.           if (Attr != Tree_NoTree) {
  1731.             {
  1732.               register Tree_yAttribute *W_45 = &Attr->U_1.V_10.Attribute;
  1733.  
  1734.               W_43->k = EvalMod3_ToBit0(W_43->TheClass, (LONGINT)W_45->AttrIndex);
  1735.               if (IN(Tree_Synthesized, W_45->Properties)) {
  1736.                 IO_WriteS(Tree_f, (STRING)"IFNOTIN (", 9L);
  1737.                 Tree_WN(W_43->k % TreeMod1_BSS);
  1738.                 IO_WriteS(Tree_f, (STRING)",", 1L);
  1739.                 EvalMod_GenEvaluator(W_44->Designators);
  1740.                 IO_WriteS(Tree_f, (STRING)"^.yyHead.yyIsComp", 17L);
  1741.                 Tree_WN(W_43->k / TreeMod1_BSS);
  1742.                 IO_WriteS(Tree_f, (STRING)") yyS", 5L);
  1743.                 Tree_WN(W_43->k);
  1744.                 IO_WriteS(Tree_f, (STRING)" (", 2L);
  1745.                 EvalMod_GenEvaluator(W_44->Designators);
  1746.                 IO_WriteS(Tree_f, (STRING)"); END;", 7L);
  1747.                 IO_WriteNl(Tree_f);
  1748.               } else if (IN(Tree_Inherited, W_45->Properties)) {
  1749.                 IO_WriteS(Tree_f, (STRING)"IFNOTIN (", 9L);
  1750.                 Tree_WN(W_43->k % TreeMod1_BSS);
  1751.                 IO_WriteS(Tree_f, (STRING)",", 1L);
  1752.                 EvalMod_GenEvaluator(W_44->Designators);
  1753.                 IO_WriteS(Tree_f, (STRING)"^.yyHead.yyIsComp", 17L);
  1754.                 Tree_WN(W_43->k / TreeMod1_BSS);
  1755.                 IO_WriteS(Tree_f, (STRING)") yyI [", 7L);
  1756.                 EvalMod_GenEvaluator(W_44->Designators);
  1757.                 IO_WriteS(Tree_f, (STRING)"^.yyHead.yyOffset + ", 20L);
  1758.                 Tree_WN(W_43->k);
  1759.                 IO_WriteS(Tree_f, (STRING)"](", 2L);
  1760.                 EvalMod_GenEvaluator(W_44->Designators);
  1761.                 IO_WriteS(Tree_f, (STRING)"^.yyHead.yyParent); END;", 24L);
  1762.                 IO_WriteNl(Tree_f);
  1763.               }
  1764.             }
  1765.           }
  1766.         }
  1767.         GenEvaluator(W_44->Next);
  1768.         return;
  1769.       }
  1770.     }
  1771.     break;
  1772.   default :
  1773.     break;
  1774.   }
  1775. }
  1776.  
  1777. void EvalMod3_BeginEvalMod3
  1778. # ifdef __STDC__
  1779. ()
  1780. # else
  1781. ()
  1782. # endif
  1783. {
  1784. }
  1785.  
  1786. void EvalMod3_CloseEvalMod3
  1787. # ifdef __STDC__
  1788. ()
  1789. # else
  1790. ()
  1791. # endif
  1792. {
  1793. }
  1794.  
  1795. static void yyExit
  1796. # ifdef __STDC__
  1797. ()
  1798. # else
  1799. ()
  1800. # endif
  1801. {
  1802.   IO_CloseIO();
  1803.   Exit(1L);
  1804. }
  1805.  
  1806. void BEGIN_EvalMod3()
  1807. {
  1808.   static BOOLEAN has_been_called = FALSE;
  1809.  
  1810.   if (!has_been_called) {
  1811.     has_been_called = TRUE;
  1812.  
  1813.     BEGIN_IO();
  1814.     BEGIN_Tree();
  1815.     BEGIN_System();
  1816.     BEGIN_IO();
  1817.     BEGIN_Tree();
  1818.     BEGIN_General();
  1819.     BEGIN_DynArray();
  1820.     BEGIN_IO();
  1821.     BEGIN_Texts();
  1822.     BEGIN_Sets();
  1823.     BEGIN_Relations();
  1824.     BEGIN_TreeMod1();
  1825.     BEGIN_TreeMod2();
  1826.     BEGIN_EvalMod();
  1827.     BEGIN_Errors();
  1828.     BEGIN_Positions();
  1829.     BEGIN_EvalMod();
  1830.     BEGIN_Tree();
  1831.  
  1832.     EvalMod3_yyf = IO_StdOutput;
  1833.     EvalMod3_Exit = yyExit;
  1834.     EvalMod3_BeginEvalMod3();
  1835.   }
  1836. }
  1837.